<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Hello World!</title>
    <!-- 
        Js代码需要编写到<script></script>标签内,
    -->
     <script>

        alert("hello world!")
        // -------------------------------------
        alert("警告框")

        console.log("向控制台输出")  
        
        document.write("在网页中写入")

     </script>
</head>
<body>
    
</body>
</html>